package com.terana.lbs.marketing.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tarena.lbs.pojo.marketing.dos.CouponDO;
import com.tarena.lbs.pojo.marketing.po.CouponPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface CouponMapper extends BaseMapper<CouponPO> {

    @Select("select * from coupon where id=#{id}")
    CouponDO selectCouponById(Integer id);

    @Select("select id from coupon where now()>start_date and now()<end_date and status = 0")
    List<Integer> getCouponIdsByTime();
}
